﻿<!DOCTYPE HTML>

<html>

<script type="text/javascript">
function check_user(Count) {
    if (Count == 0) {
        alert('Unauthorized Access. Please Contact Admin.');
    }
}
</script>


<head>


    
    @Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.vista.css"))
    
    <meta charset="UTF-8">

    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
 
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.core.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.datepicker.css")" rel="stylesheet"  type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.theme.css")" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.ui.core.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.ui.datepicker.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/DatePickerReady.js")" type="text/javascript"></script>


</head>

@{ 
        JustMVCTest.Models.PODBContext db = new JustMVCTest.Models.PODBContext();
        var user_id = User.Identity.Name;
            user_id = user_id.Replace("\\", ",");
            var words = user_id.Split(new Char[] { ',' });
            user_id = words[1];
            
            
            var users_list = from users in db.Papi_Users_tbl
                             where (users.domain_username == user_id)
                             select users;
           
           var is_admin = false;
           var is_superuser = false;
           var cc = "";
           var io = "";
           
           var Count = users_list.Count();
           if (Count > 0) 
           {
               is_admin = users_list.First().is_admin;
               is_superuser = users_list.First().is_superuser;
               cc = users_list.First().Cost_Cent;
               io = users_list.First().Int_Order;
               
           }
       }


<body onload="check_user(@Count)" style=" background-image:url(/pics/p2.jpg)">

    
        <div id="top" style="width:100%; background-color:white;padding:0px">
    
        <table width="100%">
            <tr>
                <td style="font-size:40px; color:#2577b3;font-weight:bold;">
                       POMP System
                </td>
                <td align="center">
                    <b>  
                        <font size = "3" color="0066CC">
                            @Environment.UserName, who would you like to delight today with </font> <font size = "3" color="black"> sense  </font> <font size = "3" color="0066CC"> and </font>  <font size = "3" color="black"> simplicity </font> <font size = "3" color="0066CC">? </font>
                    </b>
                </td>
                <td align="right">
                    <a href="@Url.Action("Index", "Home")"> <img style=" border-style: none; width:440px" src="/pics/philipslogo.jpg" alt="PHILIPS" /></a>
                </td>

            </tr>
        </table>
    
    </div>

    
    
    <div class="page">
        <header>

            <nav>
@{ Html.Telerik().TabStrip()
        .Name("TabStripMAIN")
        .Items(tabstrip =>
        {
            if (users_list.Count() > 0) 
            {
                tabstrip.Add()
                     .Text("Main")
                     .Action("Index", "Home");
                tabstrip.Add()
                   .Text("To Do")
                   .Action("Index", "ToDoList");
                tabstrip.Add()
                     .Text("Open POs")
                     .Action("Index", "POsList");
                tabstrip.Add()
                     .Text("All POs")
                     .Action("Index", "AllPOsList");

                if (is_superuser || is_admin || (cc != null && cc!="") || (io != null && io != "")) {
                    tabstrip.Add()
                        .Text("Reports")
                        .Action("Index", "Report");
                }
                if (is_admin) {
                        tabstrip.Add()
                         .Text("Maintenance")
                         .Action("Index", "Maintenance");
                }
            }
        })
        .Render();
} 
            </nav>
        </header>
        <section id="main">
            @RenderBody()
        </section>

    </div>

    <!-- other content -->
    @Html.Telerik().ScriptRegistrar().Globalization(true)
</body>

</html>

<!-- </div> -->
